'''
This script runs 3 other scripts from the same package to predict labels for the test file
'''

import sys
import os

num_of_parameters = len(sys.argv)
if (num_of_parameters < 4 or num_of_parameters > 4):
    print "usage: python naive_classifier.py trainig_file test_file output"
    sys.exit(0)

training_file = sys.argv[1]
test_file = sys.argv[2]
output = sys.argv[3]

#1- Create a new training file
os.system("python create_training.py "+ training_file)

#2- Calculate statistics and build a map file
os.system("python calculate_stats.py")

#3- predict labels using previously created map
os.system("python predict.py "+test_file+ " "+output)

#delete the temporary file
os.system("rm stats.map")
os.system("rm new_train.csv")